package com.hehe.boot.pojo;

import com.baomidou.mybatisplus.annotation.*;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;


@Data
@AllArgsConstructor //有参构造器
@NoArgsConstructor  //无参构造器
@TableName("book") // 对应数据库表名
public class Book {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;

    @TableField(value = "created_at",fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(value = "updated_at",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableField("deleted_at")
    @TableLogic(value = "Null")
    private LocalDateTime deletedAt;

    @TableField("username")
    @ApiModelProperty(value = "用户名")
    private String username;

    @TableField("password")
    @ApiModelProperty(value = "密码")
    private String password;

    @TableField("identity")
    @ApiModelProperty(value = "身份")
    private Integer identity;

    @TableField("related_id")
    @ApiModelProperty(value = "关联的ID")
    private Long relatedId;
}
